package com.android.xk.mask.serialPort

import io.netty.buffer.Unpooled
import tp.xmaihh.serialport.SerialHelper
import tp.xmaihh.serialport.bean.ComBean

class SerialPort(
        sPort: String,
        iBaudRate: Int,
        private val onDataReceivedListener: OnDataReceivedListener
) : SerialHelper(sPort, iBaudRate)
{

//    var onDataReceivedListener: OnDataReceivedListener? = null

    private val buff by lazy { Unpooled.buffer() }

    override fun onDataReceived(paramComBean: ComBean?)
    {
        onDataReceivedListener.onDataReceived(paramComBean)
    }

    interface OnDataReceivedListener
    {
        fun onDataReceived(paramComBean: ComBean?)
    }
}